from curl_cffi import requests
from proxy_redis import ProxyRedis
pr=ProxyRedis()
pr.ensure_domain_exists("ja")
# 获取带有指定前缀的代理IP
prefix = "JA"
name, proxy_ip = pr.get_proxies_by_prefix(domain="ja", prefix=prefix)
print(name, proxy_ip)
proxies={
    "http": proxy_ip,
    "https": proxy_ip,
}
headers = {
    "Host": "hungerstation.com",
    "content-type": "application/json",
    # "adjust-id": "1673cc1b79c5523b08263ce632669925",
    # "device-uid": "D152EF9F-B247-4C76-946D-1CA8056D9971",
    # "accept": "application/json",
    # "app-version": "1632",
    # "auth-middleware-info": "time=17:08:37.9970",
    # "perseus-client-id": "1739160070158.1390535040.uwxrbyqspx",
    # "perseus-session-id": "1739178223790.1168847331.kvufsqlomz",
    # "accept-language": "en",
    # "google-client-id": "1D31E2CB-21D1-47F4-A19C-6C48B38F5086",
    "user-agent": "HungerStation/1632 iPhone/9,2 iOS/15.8.3 CFNetwork/1335.0.3.4 Darwin/21.6.0",
    # "auth-middleware-active": "Yes",
    # "auth-middleware-access-condition": "missing"
}
url = "https://hungerstation.com/menuxp/v2/menu/73350"
params = {
    "delivery_type": "hungerstation",
    "order_flow": "1",
    "lat": "24.6909098364655",
    "long": "46.80237036198378"
}
response = requests.get(url, headers=headers, params=params,proxies=proxies)
print(response.text)
print(response.status_code)